/* =================================================
 * Package:			dk.iha.toksEditor
 * File:			JSON.java
 * Description:		A class to return from a 
 * 					RESTFull call 
 * to a JSONArray
 * 
 * Responsible
 * =================================================
 * Name:			Bjarke Jensen
 * Study number:	09676
 */

package dk.iha.toksEditor;

import java.io.BufferedReader;

/**
 *  A HTTP-response (Contains HTTP response code 
 * (eg. 404) and the response in BufferedReader)
 * 
 */
public class RequestResponse {
	/**
	 * Constructor to create a new RequestResponse
	 * containing Status and content.
	 * 
	 * @param status
	 * @param content
	 */
	RequestResponse(Integer status, BufferedReader content)
	{
		setContent(content);
		setStatusCode(status);
	}
	
	/**
	 * 	
	 * Constructor to create a new RequestResponse
	 * only containing Status
	 * 
	 * @param status
	 */
	RequestResponse(Integer status)
	{
		setStatusCode(status);
	}
	
	private Integer statusCode;
	private BufferedReader content;
	/**
	 * 
	 * @return Integer with statuscode
	 */
	public Integer getStatusCode() {
		return statusCode;
	}
	
	/**
	 * 
	 * 
	 * @param statusCode sets statuscode.
	 */
	public void setStatusCode(Integer statusCode) {
		this.statusCode = statusCode;
	}
	
	/**
	 * 
	 * 
	 * @return BufferedContent with the content.
	 */
	
	public BufferedReader getContent() {
		return content;
	}
	
	/**
	 * 
	 * 
	 * @param content Sets the content parameter.
	 */
	public void setContent(BufferedReader content) {
		this.content = content;
	}
	static public RequestResponse error()
	{
		return new RequestResponse(-1);
	}

}
